import React, { Component } from 'react'

import { RouterList } from '../utils/types'

import {NavLink} from 'react-router-dom'

import RouteView from '../router/RouteView'
interface Props extends RouterList {

}
// interface State {

// }

export default class Home extends Component<Props> {
    state = {}

    render() {
        let { routeList, navLink } = this.props
        // console.log(this.props);
        return (
            <div>
                {
                    navLink ? navLink.map((item, index) => {
                        return <NavLink
                            key={index}
                            to={item.path as string}
                        >{item.name}</NavLink>
                    }) : null
                }
                <RouteView routeList={routeList}></RouteView>
            </div>
        )
    }
}
